#ifndef __FEMPOSDEVIATION__
#define __FEMPOSDEVIATION__

#include <utility>
#include <vector>
#include <iostream>
#include <istream>
#include <streambuf>
#include <fstream>
#include "path_smooter_interface.h"

class FemPosDeviationSmoother {
public:
  explicit FemPosDeviationSmoother() = default;

  bool Solve(const std::vector<std::pair<double, double>>& raw_point2d,
             const std::vector<double>& bounds, std::vector<double>* opt_x,
             std::vector<double>* opt_y) {
                return QpWithOsqp(raw_point2d,bounds,opt_x,opt_y);
             }

  bool QpWithOsqp(const std::vector<std::pair<double, double>>& raw_point2d,
                  const std::vector<double>& bounds, std::vector<double>* opt_x,
                  std::vector<double>* opt_y);

  void Write_Path();

private:
  double weight_fem_pos_deviation_ = 1.0e10;
  double weight_path_length_ = 1.0;
  double weight_ref_deviation_ = 1.0;
  int max_iter_ = 500;
  bool verbose_ = false;
  bool scaled_termination_ = true;
  bool warm_start_ = true;

};

#endif // __FEMPOSDEVIATION__